<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
    require_once("class.connectSQL.inc");
    
    //instancia da classe
    $banco = new connectSQL();
	
?>

	<head>
    <?php include "head.php"; ?>
    <script>
    function validar(form){
    if(form.codBarProd.value == ''){
        alert("O campo Código de Barras é obrigatório.");
        return false;
    }
	if(form.desProd.value == ''){
        alert("O campo Nome é obrigatório.");
        return false;
    }
	if(form.codmarca.value == ''){
        alert("O campo Marca é obrigatório.");
        return false;
    }
   	  if (document.form.codmarca.options[codmarca.selectedIndex].value=="")
        {
          alert("Escolha um estado!");
           document.form.codmarca.focus();
        }
    return true;
	}
    </script>
	</head>
	<body>
    	<!-- Header -->
        <div id="header">
            <!-- Header. Status part -->
            <div id="header-status">
                <div class="container_12">
                    <div class="grid_8">
					&nbsp;
                    </div>
                    <div class="grid_4">
                        <a href="" id="logout">
                        Sair
                        </a>
                    </div>
                </div>
                <div style="clear:both;"></div>
            </div> <!-- End #header-status -->
            
            <!-- Header. Main part -->
            <div id="header-main">
                <div class="container_12">
                    <div class="grid_12">
                        <div id="logo">
                            <ul id="nav">
                                <li id="current"><a href="">Contatos</a></li>
                                
                            </ul>
                        </div><!-- End. #Logo -->
                    </div><!-- End. .grid_12-->
                    <div style="clear: both;"></div>
                </div><!-- End. .container_12 -->
            </div> <!-- End #header-main -->
            <div style="clear: both;"></div>
            <!-- Sub navigation -->
          
        </div> <!-- End #header -->
        
		<div class="container_12" align="center" >
        <!-- End .module -->
				<?php 
				if(isset($msg)){
				echo "<span class='notification n-success'>".$msg."</span>";
				}
				?>
				
				
                     
        
                <!-- Example table -->
                <div class="module">
                	<h2>Contatos</h2>
                    
                    <div class="module-table-body">
                    	<form action="">
                        <table id="myTable" class="tablesorter">
                        	
                                <tr>
                                    <th style="width:20%">Nome</th>
                                    <th style="width:20%">E-Mail</th>
                                    <th style="width:20%">Fone</th>
                                    <th style="width:20%">descricao</th>
                                    <th style="width:15%"></th>
                                </tr>
                            
                            <tbody>
                           
        <?php
	$resultado1 = $banco->Query("SELECT * FROM contato");
	foreach ($resultado1 as $resut){
						   ?>
         <td> <?php echo $resut['nome']; ?> </td>
         <td> <?php echo $resut['email']; ?> </td>
         <td> <?php echo $resut['fone']; ?> </td>  
         <td> <?php echo $resut['descricao']; ?> </td>                        
          <?php  
            
  		echo "</tr>";
		
   		        }          ?>  
                                
                                             
                     
                     
                      </tbody>
                        </table>
                        </form>
                     
                     
                 </div>    
                     
                     
            <div style="clear:both;"></div>
            
            <div style="clear:both;"></div>
        </div> <!-- End .container_12 -->
		
           
      
       <?php include "footer.php"; ?>
	</body>
</html>